package com.ihr360.job.core.repeat.support;

import com.ihr360.job.core.repeat.RepeatContext;
import com.ihr360.job.core.repeat.RepeatStatus;

/**
 * Interface for result holder.
 *
 * @author Dave Syer
 */
interface ResultHolder {
    /**
     * Get the result for client from this holder. Does not block if none is
     * available yet.
     *
     * @return the result, or null if there is none.
     * @throws IllegalStateException
     */
    RepeatStatus getResult();

    /**
     * Get the error for client from this holder if any. Does not block if
     * none is available yet.
     *
     * @return the error, or null if there is none.
     * @throws IllegalStateException
     */
    Throwable getError();

    /**
     * Get the context in which the result evaluation is executing.
     *
     * @return the context of the result evaluation.
     */
    RepeatContext getContext();
}